<template>
	<view>
		<!-- 1 用户 2商家 -->
		<view v-if="newstatue ==1">
			<mainPage @statue="change" :telqwe="telqwe" @changetel="changetel"></mainPage>
		</view>
		<view v-if="newstatue ==2">
			<mainindex @statue="change" :withdraws="withdraws" :balances="balances"></mainindex>
		</view>
	</view>
</template>

<script>
	import mainindex from '@/components/mainindex/mainindex.vue'
	import mainPage from '@/components/mainPage/mainPage.vue'
	export default {
		components: {
			mainindex,
			mainPage
		},
		data() {
			return {
				tel: uni.getStorageSync('phoneNumber'),
				withdraws:'',
				balances:'',
				identity: '',
				newstatue:uni.getStorageSync('newstatue')?uni.getStorageSync('newstatue'):'1',
				telqwe:''
			}
		},
		
		onLoad() {
			this.getUserInfo()
		},
		onShow() {
			this.telqwe = uni.getStorageSync('phoneNumber')
			this.getUserInfo()
			console.log('main onShow')
			//提现金额
			this.$Api.getUserWithdrawal({
				userId: uni.getStorageSync('userid'),
				shopId: uni.getStorageSync('Bshop_id'),
			}).then(res => {
				this.withdraws = res.data.data.approve
				this.balances = res.data.data.money
				console.log(res.data.data.approve, '可提现金额')
			}, err => {})
		},
		methods: {
			changetel(data){
				this.telqwe = data
			},
			change(data){
				this.newstatue = data
				uni.setStorageSync('newstatue', this.newstatue);
			},
			getUserInfo() {
				//获取用户信息
				this.$Api.getUserInfo({
					userId: uni.getStorageSync('userid'),
				}).then(res => {
					this.UserInfo = res.data.data
					this.identity = res.data.data.f_is_c
					uni.setStorageSync('identity', this.identity);
					uni.setStorageSync('phoneNumber', res.data.data.f_phone);
					console.log(res.data.data, '成功哈哈哈哈哈')
				}, err => {})
			},

		},
		mounted() {

		}
	}
</script>

<style lang="scss">
page {
  width: 100vw;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Microsoft Yahei', sans-serif;
}
view,
image,
text {
  box-sizing: border-box;
  flex-shrink: 0;
}
.information {
  width: 100%;
  height: 200rpx;
  display: flex;
  justify-content: center;
  align-items: center;
}
.information .photo {
  width: 128rpx;
  height: 128rpx;
  border-radius: 50%;
  // background-color: #55ff7f;
}
.information .information-rg {
  width: 500rpx;
  height: 100rpx;
  margin-left: 20rpx;
}
.information .information-rg .name {
  width: 224rpx;
  height: 37rpx;
  font-size: 36rpx;
  font-family: PingFang SC;
  font-weight: bold;
  color: #222222;
}
.information .information-rg .mobile {
  width: 258rpx;
  border: 1px solid #02FF83;
  border-radius: 20rpx;
  margin-top: 20rpx;
  display: flex;
  justify-content: center;
  align-items: center;
}
.information .information-rg .mobile .mobile-p {
  font-size: 22rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #03CC6D;
}
.flex-row {
  display: flex;
  flex-direction: row;
}
.flex-col {
  display: flex;
  flex-direction: column;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-around {
  justify-content: space-around;
}
.justify-evenly {
  justify-content: space-evenly;
}
.items-start {
  align-items: flex-start;
}
.items-end {
  align-items: flex-end;
}
.items-center {
  align-items: center;
}
.items-baseline {
  align-items: baseline;
}
.items-stretch {
  align-items: stretch;
}
.self-start {
  align-self: flex-start;
}
.self-end {
  align-self: flex-end;
}
.self-center {
  align-self: center;
}
.self-baseline {
  align-self: baseline;
}
.self-stretch {
  align-self: stretch;
}
.flex-1 {
  flex: 1 1 0%;
}
.flex-auto {
  flex: 1 1 auto;
}
.grow {
  flex-grow: 1;
}
.grow-0 {
  flex-grow: 0;
}
.shrink {
  flex-shrink: 1;
}
.shrink-0 {
  flex-shrink: 0;
}
.relative {
  position: relative;
}
.page {
  background-color: #f8f8f8;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}
.group {
  padding-bottom: 234rpx;
  overflow-y: auto;
}
.section {
  padding: 105rpx 32rpx 42rpx;
  background-image: linear-gradient(0deg, #f8f8f8 0%, #e6fff1 100%);
}
.space-y-63 > view:not(:first-child),
.space-y-63 > text:not(:first-child),
.space-y-63 > image:not(:first-child) {
  margin-top: 63rpx;
}
.font_1 {
  font-size: 36rpx;
  font-family: PingFang SC;
  line-height: 34rpx;
  font-weight: 700;
  color: #222222;
}
.space-y-40 > view:not(:first-child),
.space-y-40 > text:not(:first-child),
.space-y-40 > image:not(:first-child) {
  margin-top: 40rpx;
}
.space-x-20 > view:not(:first-child),
.space-x-20 > text:not(:first-child),
.space-x-20 > image:not(:first-child) {
  margin-left: 20rpx;
}
.image {
  width: 138rpx;
  height: 138rpx;
}
.group_2 {
  padding-left: 10rpx;
  padding-bottom: 9rpx;
}
.space-x-10 > view:not(:first-child),
.space-x-10 > text:not(:first-child),
.space-x-10 > image:not(:first-child) {
  margin-left: 10rpx;
}
.text-wrapper {
  padding: 10rpx 0;
  border-radius: 22rpx;
  width: 210rpx;
  border: solid 2rpx #19c865;
}
.text {
  color: #19c865;
  font-size: 24rpx;
  font-family: PingFang SC;
  font-weight: 700;
  line-height: 19rpx;
}
.group_3 {
  padding: 0 63rpx;
}
.font_2 {
  font-size: 48rpx;
  font-family: PingFang SC;
  line-height: 36rpx;
  font-weight: 700;
  color: #222222;
}
.line-tabs {
  margin-top: -13rpx;
}
.group_4 {
  padding: 0 162rpx;
}
.font_3 {
  font-size: 26rpx;
  font-family: PingFang SC;
  line-height: 26rpx;
  font-weight: 500;
  color: #666666;
}
.text_2 {
  line-height: 25rpx;
}
.text_3 {
  line-height: 25rpx;
}
.section_2 {
  margin: 46rpx 30rpx 0;
  padding-left: 29rpx;
  background-color: #ffffff;
  border-radius: 16rpx;
}
.group_5 {
  padding: 44rpx 14rpx;
  border-bottom: solid 1rpx #eeeeee;
}
.space-x-11 > view:not(:first-child),
.space-x-11 > text:not(:first-child),
.space-x-11 > image:not(:first-child) {
  margin-left: 11rpx;
}
.image_2 {
  width: 35rpx;
  height: 29rpx;
}
.font_4 {
  font-size: 28rpx;
  font-family: PingFang SC;
  line-height: 26rpx;
  font-weight: 500;
  color: #222222;
}
.text_4 {
  line-height: 27rpx;
}
.image_3 {
  width: 13rpx;
  height: 24rpx;
}
.image_4 {
  margin-right: 32rpx;
}
.group_6 {
  border-bottom: solid 1rpx #eeeeee;
}
.group_7 {
  padding: 44rpx 16rpx 40rpx;
  border-bottom: solid 1rpx #eeeeee;
}
.image_5 {
  width: 33rpx;
  height: 35rpx;
}
.image_6 {
  margin-right: 30rpx;
}
.group_8 {
  padding: 37rpx 16rpx 43rpx;
}
.space-x-12 > view:not(:first-child),
.space-x-12 > text:not(:first-child),
.space-x-12 > image:not(:first-child) {
  margin-left: 12rpx;
}
.image_7 {
  width: 34rpx;
  height: 34rpx;
}
.image_8 {
  margin-right: 32rpx;
}
.group_9 {
  margin-top: 44rpx;
  padding: 0 13rpx 39rpx;
  border-bottom: solid 1rpx #eeeeee;
}
.space-x-13 > view:not(:first-child),
.space-x-13 > text:not(:first-child),
.space-x-13 > image:not(:first-child) {
  margin-left: 13rpx;
}
.image_9 {
  margin-right: 33rpx;
}
.group_10 {
  padding: 42rpx 14rpx;
  border-bottom: solid 1rpx #eeeeee;
}
.image_10 {
  width: 33rpx;
  height: 33rpx;
}
.image_11 {
  margin-right: 32rpx;
}
.tab-bar {
  padding: 12rpx 68rpx 23rpx;
  background-color: #ffffff;
  border-top: solid 1rpx #f2f4f3;
}
.group_11 {
  height: 80rpx;
}
.space-y-4 > view:not(:first-child),
.space-y-4 > text:not(:first-child),
.space-y-4 > image:not(:first-child) {
  margin-top: 4rpx;
}
.image_12 {
  width: 54rpx;
  height: 54rpx;
}
.font_5 {
  font-size: 22rpx;
  font-family: PingFang SC;
  line-height: 22rpx;
  font-weight: 500;
  color: #9f9f9f;
}
.group_12 {
  height: 80.5rpx;
}
.text_5 {
  line-height: 21rpx;
}
.group_13 {
  height: 79.5rpx;
}
.space-y-6 > view:not(:first-child),
.space-y-6 > text:not(:first-child),
.space-y-6 > image:not(:first-child) {
  margin-top: 6rpx;
}
.text_6 {
  color: #222222;
  line-height: 20rpx;
}


</style>
